﻿using Mengsk.ProxyDelivery.Domain;
using Mengsk.ProxyDelivery.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Mengsk.ProxyDelivery.Print.Domain.PrintDataFormatters
{
    class PrintDataFormatterReceiver_Area : PrintDataFormatter
    {
        public override PrintTemplateItemTypes AcceptType
        {
            get { return PrintTemplateItemTypes.RECIVER_AREA; }
        }

        public override object Format(PrintTemplate template, PrintTemplateItem item, Order order)
        {
            var a = AddressService.ParseRegion(order.ReceiverAddress);
            if (a == null)
            {
                MessageBox.Show(order.ReceiverAddress, "没有找到区");
                return "";
            }
            return a.Name;
        }
    }
}
